package com.springTest;

import com.SpringbootMybatisApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

//加上这两个注解，运行测试方法的时候就会启动SpringBoot
@RunWith(SpringRunner.class)
@SpringBootTest(classes = SpringbootMybatisApplication.class)
public class UserMapperTest {
    @Autowired
    private Teacher teacher;

    @Test
    public void testUser(){
        System.out.println(teacher);
        System.out.println(teacher);
        System.out.println(teacher.getStudent());
        System.out.println(teacher.getStudent());
    }
}